<?php class Easy_Coach_Widget extends WP_Widget {


	/**
	 * Register widget with WordPress.
	 */
	public function __construct() {
		$widget_ops = array('classname' => 'easy-coach-login', 'description' => __( 'Login to Easy Coach', 'tsv-bierden') );
		parent::__construct('easy-coach-login', __('Easy Coach Login', 'tsv-bierden'), $widget_ops);
	}

	/**
	 * Front-end display of widget.
	 *
	 * @see WP_Widget::widget()
	 *
	 * @param array $args     Widget arguments.
	 * @param array $instance Saved values from database.
	 */
	public function widget( $args, $instance ) {
		$title = apply_filters('widget_title', $instance['title'] );
		extract($args);
		
		$html = '
			<div id="E2CC"><a href="http://www.easy2coach.net/de/start.html">Fu&szlig;balltraining</a></div>
			<script language="Javascript" type="text/javascript"> 
			var LW=200; var FC="004F94"; var BC="none"; var BW=1; var BGC="EEEEEE";</script> 
			<script language="Javascript" type="text/javascript" src="http://www.easy2coach.net/wdgts/e2cl.js"></script>
		';
		
		
		/* Before widget (defined by themes). */
		echo $before_widget;
		
		/* Display Title of the widget */
		if ( $title ) {
			echo $before_title . $title . $after_title;
		}
		
		/* Display content of the widget */
		
		echo $html;
				
		/* After widget (defined by themes). */
		echo $after_widget;
	}

	/**
	 * Back-end widget form.
	 *
	 * @see WP_Widget::form()
	 *
	 * @param array $instance Previously saved values from database.
	 */
 	public function form( $instance ) {
	}

	/**
	 * Sanitize widget form values as they are saved.
	 *
	 * @see WP_Widget::update()
	 *
	 * @param array $new_instance Values just sent to be saved.
	 * @param array $old_instance Previously saved values from database.
	 *
	 * @return array Updated safe values to be saved.
	 */
	public function update( $new_instance, $old_instance ) {
	}
}

// register Foo_Widget widget
function register_easy_coach_widget() {
	register_widget( 'Easy_Coach_Widget' );
}
add_action( 'widgets_init', 'register_easy_coach_widget' );